-
Notifications
You must be signed in to change notification settings - Fork 219
Force updater to only update runtime files if there is only 1 PoB instance #1516
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
Adds a safeguard when updating runtime files that all other instances of PoB are closed so that the updater doesn't run into issues For linux systems it instead shows a popup as we can't reliably detect the instance count
mode == "basic" already means we are touching runtime files so no need for extra work
src/HeadlessWrapper.lua
Outdated
| function GetProcessCount(names) | ||
| return 1 | ||
| end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You wanna keep this to pass CI
|
|
||
| -- Returns the total number of running processes that match any known PoB executable names. | ||
| local function getMatchingProcessCount() | ||
| if not isWindows then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of using isWindows anywhere, just call the function and return the error. You could make the error say something platform related on the C++ side.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works well, though the white error box is a bit jarring. Maybe we can use updateErrMsg instead, like this:

The only concern with this approach would be that the message gets missed or ignored.
Code for this if you want to use it:
local prompt = string.format("%d other Path of Building %s %s open.\nClose other copies before applying this update,\nthen press Update again.", otherCount, instanceLabel, verb)
--self:ShowPrompt(1, 0.5, 0, prompt)
self.updateErrMsg = promptWe'd have to mess with the Update button behavior and title text too to make it perfect
Description of the problem being solved:
When PoB updates its runtime files it will fail to update if you have more than 1 instance of PoB open. This PR adds a check for if you have more than 1 instance open and will not let you update until you've closed them
Steps taken to verify a working solution:
After screenshot: